﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using Medical.Business;

public partial class control_TopFaq : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            DataTable dtFaq = new BisFeedBack().GetTopList(7, 0);
            string strInfo = string.Empty;
            if (dtFaq.Rows.Count > 0)
            {
                ltlTitle.Text = Server.HtmlEncode(dtFaq.Rows[0]["Title"].ToString());
                strInfo = Common.NoHTML(dtFaq.Rows[0]["Info"].ToString());
                ltlInfo.Text = (strInfo.Length > 25 ? strInfo.Substring(0, 25) : strInfo) + "…" +
                                 "<a href=\"/faq/" + dtFaq.Rows[0]["SortUrlName"].ToString() + "/" + dtFaq.Rows[0]["ID"].ToString() + ".html\" title=\"" + dtFaq.Rows[0]["Title"].ToString() + "\" target=\"_blank\">[详情]</a>";
                dtFaq.Rows.RemoveAt(0);
                dtFaq.AcceptChanges();
            }
            if (dtFaq.Rows.Count > 0)
            {
                ltlTitle1.Text = Server.HtmlEncode(dtFaq.Rows[0]["Title"].ToString());
                strInfo = Common.NoHTML(dtFaq.Rows[0]["Info"].ToString());
                ltlInfo1.Text = (strInfo.Length > 25 ? strInfo.Substring(0, 25) : strInfo) + "…" +
                                 "<a href=\"/faq/" + dtFaq.Rows[0]["SortUrlName"].ToString() + "/" + dtFaq.Rows[0]["ID"].ToString() + ".html\" title=\"" + dtFaq.Rows[0]["Title"].ToString() + "\" target=\"_blank\">[详情]</a>";
                dtFaq.Rows.RemoveAt(0);
                dtFaq.AcceptChanges();
            }
            rptFaq.DataSource = dtFaq;
            rptFaq.DataBind();
        }
    }
}